package com.task;

import com.blade.ioc.annotation.Bean;
import com.blade.task.annotation.Schedule;
import com.util.StatisticsUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Bean
public class SaveTask {
    /**
     * 5分钟
     */
    @Schedule(name = "task1", cron = "0 */5 * * * ?")
//    @Schedule(name = "task1", cron = "*/5 * * * * ?")
    public void saveStatistics() {
        StatisticsUtil.save();
        log.info(System.currentTimeMillis() + "");
    }

    /**
     * 每晚一点不见不散
     */
//    @Schedule(name = "task2", cron = "0 0 1 * * ?")
//    public void RemoveOldFile() {
//        StatisticsUtil.RemoveOldFile();
//    }
}